#include "junix.h"

int main(int argc, char **argv)
{
	if(argc==1)
		err_quit("Usage:%s file",argv[0]);
	FILE *fp;
	if( (fp=fopen(argv[1], "r")) == NULL)
			err_quit("open error");

	size_t sz=1024;
	char buf[1024];
	int lineno = 1;
	while( fgets(buf,sz,fp) != NULL )
	{
//		buf[ strlen(buf)-1 ]='\0';
		printf("%d  %s",lineno++,buf);
	}

	printf("\n");

	return 0;
}

